/*
 * DConfConexCirculImportIGF.java
 *
 * Created on 17 de abril de 2008, 09:29 AM
 */

package ig.formato.gui.app;

import ig.formato.dto.ConexionDTO;
import java.util.Collection;

/**
 *
 * @author  jsanchez
 */
public class DConfConexCirculImportIGF extends javax.swing.JDialog {
    
    /** Creates new form DConfConexCirculImportIGF */
    public DConfConexCirculImportIGF(java.awt.Frame parent, boolean modal,Collection<ConexionDTO> conexiones) {
        super(parent, modal);
        initComponents();        
        for (Object elem : conexiones) {
            this.CBConexiones.addItem(elem);
        }
        java.awt.Dimension dimensionScreen = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        java.awt.Rectangle dimensionPantalla = getBounds();
        setLocation((dimensionScreen.width - dimensionPantalla.width) / 2, (dimensionScreen.height - dimensionPantalla.height) / 2);
    }
    private Integer conexion=null;

    public Integer getConexion() {
        return conexion;
    }

    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        CBConexiones = new javax.swing.JComboBox();
        BAceptar = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
        setTitle(org.openide.util.NbBundle.getMessage(DConfConexCirculImportIGF.class, "DConfConexCirculImportIGF.title")); // NOI18N
        setResizable(false);

        jLabel1.setFont(new java.awt.Font("Dialog", 0, 10));
        jLabel1.setText(org.openide.util.NbBundle.getMessage(DConfConexCirculImportIGF.class, "DConfConexCirculImportIGF.jLabel1.text")); // NOI18N

        CBConexiones.setFont(new java.awt.Font("Dialog", 0, 10));
        CBConexiones.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                CBConexionesActionPerformed(evt);
            }
        });

        BAceptar.setFont(new java.awt.Font("Dialog", 0, 10));
        BAceptar.setText(org.openide.util.NbBundle.getMessage(DConfConexCirculImportIGF.class, "DConfConexCirculImportIGF.BAceptar.text")); // NOI18N
        BAceptar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BAceptarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(CBConexiones, 0, 322, Short.MAX_VALUE)
                            .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 322, Short.MAX_VALUE)))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(133, 133, 133)
                        .addComponent(BAceptar, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(CBConexiones, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(BAceptar)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void CBConexionesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CBConexionesActionPerformed
        // TODO add your handling code here:
        conexion=this.CBConexiones.getSelectedIndex();
    }//GEN-LAST:event_CBConexionesActionPerformed

    private void BAceptarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BAceptarActionPerformed
        this.setVisible(false);
        // TODO add your handling code here:
    }//GEN-LAST:event_BAceptarActionPerformed
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton BAceptar;
    private javax.swing.JComboBox CBConexiones;
    private javax.swing.JLabel jLabel1;
    // End of variables declaration//GEN-END:variables
    
}
